package com.gitee.Transformation

import org.apache.flink.api.scala.ExecutionEnvironment

/*
  根据函数将每一个元素打撒
 */
object FlatMapTest {
  def main(args: Array[String]): Unit = {
    val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
    import org.apache.flink.api.scala._
    env.setParallelism(1)
    case class User(id: String, name: String)
    val lineData: DataSet[String] = env.fromElements("1,张三", "2,李四", "3,王五", "4,赵六")

    lineData.flatMap(_.split(",")).print()
  }

}
